 /**
   * Copyright 2014 Viettel Telecom. All rights reserved.
   * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   */
  package com.viettel.core.enumtype;
  import java.util.HashMap;
  import java.util.Map;
  /**
   *  Mo ta muc dich cua lop (interface)
   *  @author: TOANTM1
   *  @version:  
   *  @since: 27/02/2014 - 11:34:02
   */
  public enum QuestionsType {
      
      TYPE_0 (0),
      TYPE_1 (1),
      TYPE_2 (2);
      
      
      /** The value. */
      private Integer value;
      
      /** The values. */
      private static Map<Integer, QuestionsType> values = null;
      
      /**
       * Gets the value.
       * 
       * @return the value
       */
      public Integer getValue() {
          return value;
      }
      
      /**
       * Instantiates a new gender type.
       * 
       * @param value
       *            the value
       */
      QuestionsType(Integer value) {
          this.value = value;
      }
      
      /**
       * Parses the value.
       * 
       * @param value
       *            the value
       * @return the gender type
       */
      public static QuestionsType parseValue(Integer value) {
      	if (value != null && value == -1){
      		value = 2;
      	}    		
          if (values == null) {
              values = new HashMap<Integer, QuestionsType>(
                      QuestionsType.values().length);
              for (QuestionsType e : QuestionsType.values())
                  values.put(e.getValue(), e);
          }
          return values.get(value);
      }
  }
 
